<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
    <%@ page language="java" import="java.util.*,com.yigerende.pojo.*"%>
    <%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/jsp/admin/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/jsp/admin/css/main.css" />
	
<script type="text/javascript">
//使用js来提交给后端要删除的id和类型
	function delMange(type,id){
		if (confirm("您确定要删除该信息？"))
		top.location ="<%=path%>/admin/AdminNewsServlet?flag=_delNews&&id="+id+"&type="+type;
		return false;
	}
</script>
</head>
<body style="background:url(<%=path%>/image/856.jpg);background-repeat: no-repeat;background-position: center center;background-size: cover;">
	<jsp:include page="top.jsp" />
	<div class="container clearfix">
		<jsp:include page="left.jsp" />
		<div class="main-wrap">

			<div class="crumb-wrap">
				<div class="crumb-list">
					<i class="icon-font"></i><a href="<%=path%>/jsp/admin/index.jsp">首页</a><span
						class="crumb-step">&gt;</span>
						
						<span class="crumb-name">
							<%Integer type = Integer.parseInt(String.valueOf(request.getAttribute("type")));
								if(type == 1){
									%>幻灯片管理<%
								}else if(type == 2){
									%>首页总部新闻管理<%
								}else if(type == 3){
									%>合作伙伴管理<%
								}else if(type == 4){
									%>党建工作管理<%
								}else if(type == 5){
									%>公司新闻管理<%
								}else if(type == 6){
									%>院校新闻管理<%
								}else if(type == 7){
									%>行业新闻管理<%
								}else if(type == 8){
									%>媒体报道管理<%
								}else if(type == 9){
									%>总部招聘管理<%
								}else if(type == 11){
									%>院校招聘管理<%
								}else if(type == 15){
									%>首页院校新闻管理<%
								}
							%>
						</span>
				</div>
			</div>
			<%
				List<Cooperative> CooperList = (List<Cooperative>) request.getAttribute("newsList");
				List<News> newsList = (List<News>) request.getAttribute("XinWenList");
				List<Applications> appList = (List<Applications>) request.getAttribute("zhaoList");
				List<LiuYan> YanList = (List<LiuYan>) request.getAttribute("LiuYan");
			%>
			<div class="result-wrap">
				<form name="myform" id="myform" method="post">
					<div class="result-title">
						<div class="result-list">
							<%
								if(type == 1){
							%>
							<a href="<%=path %>/jsp/admin/addnews.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加幻灯片</a>
							<%
								}else if(type == 2){
							%>
							<a href="<%=path %>/jsp/admin/addnews2.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加总部新闻</a>
							<%
								}else if(type == 3){
							%>
							<a href="<%=path %>/jsp/admin/addnews2.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加合作伙伴</a>
							<%
								}else if(type == 4){
							%>
							<a href="<%=path %>/jsp/admin/addnews3.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加党建工作</a>
							<%
								}else if(type == 5){
							%>
							<a href="<%=path %>/jsp/admin/addnews3.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加公司新闻</a>
							<%
								}else if(type == 6){
							%>
							<a href="<%=path %>/jsp/admin/addnews3.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加院校新闻</a>
							<%
								}else if(type == 7){
							%>
							<a href="<%=path %>/jsp/admin/addnews3.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加行业新闻</a>
							<%
								}else if(type == 8){
							%>
							<a href="<%=path %>/jsp/admin/addnews3.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加媒体新闻</a>
							<%
								}else if(type == 9){
							%>
							<a href="<%=path %>/jsp/admin/addnews4.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加总部招聘</a>
							<%
								}else if(type == 11){
							%>
							<a href="<%=path %>/jsp/admin/addnews4.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加院校招聘</a>
							<%
								}else if(type == 15){
							%>
							<a href="<%=path %>/jsp/admin/addnews2.jsp?type=<%=type %>">
								<i class="icon-font">&</i>添加首页院校新闻</a>
							<%
								}
							%>
							
						</div>
					</div>
					<div class="result-content">
						<table class="result-tab" width="100%">
							<tr>
									<%
										if(type == 3){
									%>
									<th>序号</th>
									<th>标题</th>
									<th>链接地址</th>
									<th>图片名称</th>
									<th>简介</th>
									<th>显示时间</th>
									<th colspan="2">操作</th>
									<%	
										}else if(type == 5 || type == 7){
									%>
									<th>序号</th>
									<th>标题</th>
									<th>内容</th>
									<th>链接地址</th>
									<th>添加时间</th>
									<th>描述</th>
									<th>显示日</th>
									<th>显示年</th>
									<th colspan="2">操作</th>
									<%
										}else if(type == 9){
									%>
									<th>序号</th>
									<th>标题</th>
									<th>月薪</th>
									<th>工作地点</th>
									<th>岗位职责</th>
									<th>任职要求</th>
									<th colspan="2">操作</th>
									<%
										}else if(type == 10){
									%>
									<th>序号</th>
									<th>姓名</th>
									<th>电话</th>
									<th>Email</th>
									<th>其他联系方式</th>
									<th>留言内容</th>
									<th colspan="2">操作</th>
									<%
										}
									%>
							</tr>
							 <%
							 	if (type == 3){
							    //把当前页面数据循环显示出来
								for(int i=0;i<CooperList.size();i++){
							%> 
							<tr>
								<td><%=CooperList.get(i).getId()%></td>
								<td><%=CooperList.get(i).getTitle()%></td>
								<td><%=CooperList.get(i).getLianjie()%></td>
								<td><%=CooperList.get(i).getPic()%></td>
								<td><%=CooperList.get(i).getJianjie()%></td>
								<td><%=CooperList.get(i).getShijian()%></td>
								   <td>
										<a class="link-del" href="<%=path %>/admin/AdminNewsServlet?flag=_editNews&id=<%=CooperList.get(i).getId() %>&type=<%=type %>">
											编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
										<a class="link-del" href="#" onClick="delMange(<%=type %>,<%=CooperList.get(i).getId() %>);">
										删除</a>
								</td>   
							</tr>
							<%
									}
							 	}else if(type == 5 || type == 7){
							 		for(int i=0;i<newsList.size();i++){
							%>
							 <tr>
								<td><%=newsList.get(i).getId()%></td>
								<td><%=newsList.get(i).getTitle()%></td>
								 <td><%=newsList.get(i).getContent()%></td>
								<td><%=newsList.get(i).getUrl()%></td>
								<td><%=newsList.get(i).getAddtime()%></td>
								<td><%=newsList.get(i).getTemp1()%></td>
								<td><%=newsList.get(i).getTemp2()%></td>
								<td><%=newsList.get(i).getTemp3()%></td>
								   <td>
										<a class="link-del" href="<%=path %>/admin/AdminNewsServlet?flag=_editNews&id=<%=newsList.get(i).getId() %>&type=<%=type %>">
											编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
										<a class="link-del" href="#" onClick="delMange(<%=type %>,<%=newsList.get(i).getId() %>);">
										删除</a>
								</td>
							</tr> 
							<%
									}
							 	}else if(type == 9){
							 		for(int i=0;i<appList.size();i++){
							%>
							<tr>
								<td><%=appList.get(i).getId()%></td>
								<td><%=appList.get(i).getTitle()%></td>
								<td><%=appList.get(i).getPrice()%></td>
								<td><%=appList.get(i).getGzdd()%></td>
								<td><%=appList.get(i).getZz()%></td>
								<td><%=appList.get(i).getRz()%></td>
								   <td>
										<a class="link-del" href="<%=path %>/admin/AdminNewsServlet?flag=_editNews&id=<%=appList.get(i).getId() %>&type=<%=type %>">
											编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
										<a class="link-del" href="#" onClick="delMange(<%=type %>,<%=appList.get(i).getId() %>);">
										删除</a>
								</td>
							</tr> 
							 <%
							 	}
							 }else if(type == 10){
								 for(int i=0;i<YanList.size();i++){
							%> 
							<tr>
								<td><%=YanList.get(i).getId()%></td>
								<td><%=YanList.get(i).getName()%></td>
								<td><%=YanList.get(i).getPhone()%></td>
								<td><%=YanList.get(i).getEmail()%></td>
								<td><%=YanList.get(i).getQiTa()%></td>
								<td><%=YanList.get(i).getLiuYan()%></td>
								   <td>
										<a class="link-del" href="#" onClick="delMange(<%=type %>,<%=YanList.get(i).getId() %>);">
										删除</a>
								</td>
							</tr> 
							<%
							 }
							 }
							%>
						</table>
						  <div class="list-page">
							<a
								href="<%=path%>/admin/AdminNewsServlet?flag=_seequeryNews&currentPage=1&type=${type}">首页</a><!-- 直接给currentPage给个1 -->
							<a
								href="<%=path%>/admin/AdminNewsServlet?flag=_seequeryNews&currentPage=${currentPage<=1?currentPage:currentPage-1}&type=${type}">上一页</a>
							<a
								href="<%=path%>/admin/AdminNewsServlet?flag=_seequeryNews&currentPage=${currentPage<bottomPage?currentPage+1:bottomPage}&type=${type}">下一页</a>
							<a
								href="<%=path%>/admin/AdminNewsServlet?flag=_seequeryNews&currentPage=${bottomPage}&type=${type}">尾页</a>
						</div> 
					</div>
				</form>
			</div>
		</div>
		<!--/main-->
	</div>
</body>
</html>